import http from "@/utils/http/hub";

/**
 * 消息
 */
export const myMessage = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/message/myMessage`,
    params,
    config,
  });
};

/**
 * 优惠促销列表
 */
export const salesMessageList = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/message/salesMessage`,
    params,
    config,
  });
};

/**
 * 系统通知列表
 */
export const userMessageList = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/message/userMessage`,
    params,
    config,
  });
};

/**
 * 一键已读
 */
export const readAllMessage = (
  params,
  config = {
    custom: {
      loading: true,
    },
  }
) => {
  return http.post({
    url: `/message/readAllMessage`,
    params,
    config,
  });
};
